<div id="wrapper">
    <div id="main_content">
        
        <div class="fistArt3">
            <ul>
                <?php foreach ($listnews as $news) { ?>
                    <li>
                            
                        <div class="news_title_big">
                            <a href="index.php?r=detail/view&id=<?php echo $news -> news_id; ?>"><?php echo $news->news_title ?></a>
                        </div>
                        <div class="news_post_time">
                            <?php echo $news->news_created_at ?>
                        </div>
                        <div class="news_image_big">
                            <a href="index.php?r=detail/view&id=<?php echo $news -> news_id; ?>">
                                <?php
                                   $text = $news->news_content;
                                   if ((bool) preg_match('#<img[^>]+src=[\'"]([^\'"]+)[\'"]#', $text, $matches)) {
                                       print($matches[0]);
                                   }else{?>
                                       <img src="images/2.gif" />
                                   <?php } ?> 
                           </a></a>     
                        </div>
                      
                        <div class="news_content_big">
                            <?php echo strip_tags(htmlspecialchars_decode($news -> news_description)); ?>
                        </div>
                      
                    </li>
                    <?php } ?>
            </ul>
        </div>
        
    </div>
    <!--
    <div id="ad_center">
        <h2 style="text-align: center;color:#555;">Ads 1000x100</h2>
    </div>
    -->
 	<div id="ads_content">
        <div id="hot_video">
            <h2>Quảng cáo</h2>
            <ul>
            	<?php foreach($ads as $ad){ ?>
			                <li>
				<div class="ads_title">
					<a href="<?php echo $ad->ads_url; ?>"><?php echo $ad -> ads_title; ?></a>
				</div>
				<div class="ads_website">
					<a href="<?php echo $ad-> ads_url; ?>"><?php echo $ad -> ads_website; ?></a>
				</div>
				<div class="ads_content">
					<a href="<?php echo $ad -> ads_url; ?>">
						<?php if($ad->ads_image != null){?>
							<img src="<?php echo $ad -> ads_image; ?>" /> 
						<?php }else{ ?>
							<img src="images/default.jpg" /> 
						<?php } ?>
					</a>
					<div class="ads_desc">
						<?php echo $ad-> ads_desc; ?>
					</div>
				</div>
			</li>
			<?php } ?>
			
            </ul>
        </div>
    </div>

    <!--  end ads content -->
</div>